package com.day07.ex03;

public class Student {
    String name;
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int a) {
        if (a < 0 || a > 120) {
            System.out.println("你给的年龄有误");
        } else {
            age = a;
        }
        class StudentDemo {
            public void main(String[] args) {
                Student s = new Student();
                s.name = "";
                s.setAge(30);
                s.show();
            }
        }

    }

    void show() {
        System.out.println(name + "," + age);
    }
}
